<?php $this->renderPartial('_view/form-send-message', array('modelUser' => $modelUser)); ?>

<div class="left">      
    <div class="list-upload">
	<?php foreach ($aPosts as $post) { ?>
    	<div class="box-li">
    	    <div class="left-li">
    		<img src="<?php echo $post->user->getAvatarUrl() ?>" />
    		<p><a href="<?php echo SITE_NAME_URL ?>user/<?php echo $post->user_id ?>"><?php echo h($post->user->username, 9); ?></a></p>
    	    </div>
    	    <div class="right-li">
    		<div class="mui"></div>
    		<ul class="menu-icon">
    		    <li>
    			<img src="<?php echo WWW_URL ?>images/date.jpg" /> Date: <?php echo date('F d,Y', strtotime($post->time_created)) ?>
    		    </li>
    		    <li><img src="<?php echo WWW_URL ?>images/comment.jpg" /> <a><?php echo $post->total_comment ?></a></li>
    		    <li title="Copy Url of this post">
    			<span class="contain-url">Url: </span><span class="contain-url" id="url<?php echo $post->post_id ?>"><?php echo SITE_NAME_URL ?>post/<?php echo $post->post_id ?></span>
    			<a id="copy-link-<?php echo $post->post_id ?>" href="javascript:void(0)"><i><img src="<?php echo WWW_URL ?>img/copy-icon.png"/></i> Copy URL</a>
    		    </li>
    		</ul>
    		<h4><a href="<?php echo SITE_NAME_URL ?>post/<?php echo $post->post_id ?>"><?php echo h($post->title, 50, FilterWord::getListFilter()) ?></a></h4>
    		<div class="text-li">
			<?php echo h($post->content, 180, FilterWord::getListFilter()); ?>
    		</div>
		    <?php /* <a href="#"><img src="images/file.jpg" /> Document Reading</a> */ ?>
    	    </div>
    	</div><!--box-li-->
	    <?php
	    /**
	     * copy link to clip board
	     */
	    ?>

    	<script>

    	    $(document).ready(function() {

    		$('a#copy-link-<?php echo $post->post_id ?>').zclip({
    		    path: 'http://davidwalsh.name/demo/ZeroClipboard.swf',
    		    copy: $('#url<?php echo $post->post_id ?>').text()
    		});
    	    });
    	</script>
	<?php } ?>

	<!-- ************************************** START PAGINATOR *************************************-->
	<div class="pagination pagination-1 post-paginator">
	    <?php
	    $this->widget('bootstrap.widgets.TbPager', array(
		'pages' => $pages
	    ))
	    ?>
	    <div class='total-record'>
		<?php
		if ($iTotalRecord > Posts::TOTAL_RECORD) {
		    $array = getPageination($pages);
		    ?>
    		Showing <?php echo $array['start']; ?>-<?php echo $array['end']; ?> of <?php echo $iTotalRecord; ?>    		    
		<?php } ?>
	    </div>
	</div>
	<!-- ************************************** END PAGINATOR *************************************-->


    </div>
</div>
<div class="right">
    <div class="box-right">
	<?php $this->renderPartial('_view/profile', array('modelUser' => $modelUser)); ?>

    </div><!--box-right-->
    <div class="box-right">
	<?php $this->renderPartial('_view/friend', array('modelFriend' => $modelFriend, 'userId' => $modelUser->user_id)); ?>
    </div><!--box-right-->   

</div><!--right-->
